package router

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
	"tuowei.com/app/api/apis"
	"tuowei.com/common/middleware"
)

func init() {
	routerCheckRole = append(routerCheckRole, registerLearningListRouter)
}

func registerLearningListRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.ApiLearningList{}
	r := v1.Group("/learning").Use(authMiddleware.MiddlewareFunc()).Use(middleware.CheckLogin)
	r.GET("", api.GetPages)
	r.GET("/course/:course_id", api.Get)
	r.POST("/course/insert", api.Insert)
	r.POST("/course/statistics", api.CourseLearnStatistics)
	r.POST("/course/duration", api.StudyDurationStatistics)
}
